import { useLocalStorage } from './useStorage'

const ACCESS_TOKEN_KEY = 'access_token'

export function useAuth() {
  const [accessToken, setAccessToken] = useLocalStorage(ACCESS_TOKEN_KEY)
  console.log('accessToken', accessToken)

  const isLogin = !!accessToken

  const login = () => {
    const token = 'sd'
    setAccessToken(token)
  }

  return {
    isLogin,
    login,
  }
}
